package com.flow.engine.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.flow.engine.entity.FlowNode;
import com.flow.engine.mapper.FlowNodeMapper;
import com.flow.engine.service.FlowNodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ly163
 */
@Service
public class FlowNodeServiceImpl extends ServiceImpl<FlowNodeMapper, FlowNode> implements FlowNodeService {


    @Autowired
    private FlowNodeMapper mapper;
    @Override
    public FlowNode selectById(Long id) {
        return mapper.selectById(id);
    }


    @Override
    public List<FlowNode> queryNodesByFlowId(Long flowId) {

        return list(Wrappers.<FlowNode>lambdaQuery().eq(FlowNode::getFlowId, flowId).isNull(FlowNode::getApprovalState));
    }
}
